package ui.gui.table.model;

import javax.swing.table.AbstractTableModel;
import model.Order;

/**
 *
 * @author Martin Mohr Pedersen
 */
public class SalesHistoryTableModel extends AbstractTableModel {

    private static final int COL_PHONE = 0;
    private static final int COL_AMOUNT = 1;
    private static final int COL_DELIVERY = 2;
    private String[] columnNames = {"Kunde telefon", "Total Beløb", "Levering"};
    private Class[] columnTypes = {java.lang.String.class, java.lang.Double.class, 
        java.lang.Boolean.class};

    public SalesHistoryTableModel() {
        
    }

    @Override
    public int getRowCount() {
        throw new UnsupportedOperationException("Not yet implemented");

    }

    @Override
    public int getColumnCount() {
        return columnNames.length;
    }

    @Override
    public String getColumnName(int index) {
        return columnNames[index];
    }

    @Override
    public Class getColumnClass(int index) {
        return columnTypes[index];
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        throw new UnsupportedOperationException("Not yet implemented");
        
        /*
        Order sale = sales.getAllSales()[rowIndex];
        switch (columnIndex) {
            case COL_PHONE:
                try {
                    return sale.getCustomer().getPhone();
                } catch (NullPointerException npe) {
                    return 0;
                }
            case COL_AMOUNT:
                return sale.getSalePrice();
            case COL_DELIVERY:
                if (sale.getDelivery() == null){
                    return false;
                } else {
                    return true;
                }
            default:
                return null;
        }
         */
    }
}
